<!DOCTYPE html>
<html>

<head>
    <meta charset="UTF-8">
    <title>我的信息评论页面</title>
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <link rel="stylesheet" href="/js/bootstrap/css/bootstrap.min.css">
    <script src="/js/jquery/jquery.min.js"></script>
    <script src="/js/bootstrap/js/bootstrap.min.js"></script>
    <script src="/js/plugins/jrender/jrender.min.js"></script>
    <link rel="stylesheet" href="/css/font/css/font-awesome.min.css">
    <link rel="stylesheet" href="/css/reset.css">
    <link rel="stylesheet" href="/css/userProfiles.css">
    <link rel="stylesheet" href="/js/plugins/dialog2/dialog.css">
    <script src="/js/plugins/dialog2/dialog.min.js"></script>
    <script src="/js/common.js"></script>
    <script src="/js/plugins/jquery-form/jquery.form.js"></script>

    <script>
        $(function () {
            //获取当前登录用户
            var user = JSON.parse(sessionStorage.getItem("user"));
            console.log(user);
            if(user.id){
                //我的评论
                $.get("/addComments",{userId:user.id},function (data) {
                    console.log(data);
                    $("#pills-tabContent").renderValues(data,{
                        setHref:setHref
                    });
                })

                var params = getParams();
                $.get("/users/strategyComment",{strategyCommentId:params.id},function (data) {
                    $(".comment-link").renderValues(data,{
                        'setStrategy':setHref
                    });

                    var html='';//用于临时拼接评论图片

                    $.each(data.list,function (index, ele) {

                        //图片地址切割
                        var arr=(ele.imgUrls).split(";");
                        //循环拼接图片
                        $.each(arr,function (index1,ele1) {
                            if(index1<arr.length-1){
                                html+='<li><img src="'+ele1+'"></li>';
                            }
                        })

                    })
                    $(".comment-img").append(html);//将图片设置回去
                })
            }
        })
    </script>
</head>
<body>
<div class="container ">
    <a href="/mine/message.html" class="my-arrow">
        <span><i class="fa fa-chevron-left fa-2x"></i></span>
    </a>
</div>

<div class="tabs">
    <ul class="nav nav-pills nav-justified  border border-left-0 border-top-0 border-right-0" id="pills-tab"
        role="tablist">
        <li class="nav-item">
            <a class="nav-link " id="comments-tab" data-toggle="pill" href="#comments">
                我的评论
            </a>
        </li>
    </ul>
    <div class="container tab-content" id="pills-tabContent">
        <div class="comment " id="comments">
            <div render-loop="list">
                <div class="row">
                    <div class="col-2 comment-head">
                        <img class="rounded-circle" render-src="list.user.headImgUrl">
                    </div>
                    <div class="col">
                        <h5 render-html="list.user.nickName">xxx</h5>
                        <span class="comment-date" render-html="list.createTime">2018-07-11</span>
                        <div>
                            <h6 class="comment-date">评论了我:</h6>
                            <a href="/strategyComment.html?id=" render-key="list.strategyCommentId" render-fun="setHref">
                                <h5 render-html="list.content">骑了个单车到沙面，春风把从上下九和宝华路带来的燥热吹散。沙面临江，下午的时光让这富有异国风情的公园显得更加宁静惬意，哪怕...</h5>
                            </a>
                        </div>
                        <ul class="comment-img">
                        </ul>

                        <!--<div class="comment-link">
                            <a href="/strategyCatalogs.html?id=" render-fun="setStrategy" render-key="list.strategy.id">
                                <img render-src="list.strategy.coverUrl"> <span render-html="list.strategy.title">广州攻略</span>
                                <i class="fa fa-angle-right fa-2x"></i>
                            </a>
                        </div>-->
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>


</body>
</html>